using UnityEngine;
using System.Collections;
using System.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;


public class SAPalConfig : Singleton< SAPalConfig > 
{
	public Color32[] PAL = new Color32[ GameDefine.MAX_COLOR ];


	void Awake ()
	{
		if ( mInstance == null )
		{
			mInstance = this;

			// init here ,

			initConfig();
		}
		

	}

	public void load( string path )
	{
		FileStream stream = File.Open( GameSetting.StreamingAssetsPath + path + ".sa" , FileMode.Open , FileAccess.Read );

		for ( int i = 0 ; i < GameDefine.MAX_COLOR ; i++ )
		{
			int r1 = stream.ReadByte();
			int g1 = stream.ReadByte();
			int b1 = stream.ReadByte();
			int a1 = 255;

			PAL[ i ] = new Color32( (byte)r1 , (byte)g1 , (byte)b1 , (byte)a1 );
		}

		PAL[ 0 ].a = 0;

		stream.Close();
	}

	public void initConfig()
	{
		load( "pal" );
	}
	
	public void clearConfig()
	{
	}

	
	
}


